<?php
//start the session
session_name("EquipmentCheckout");
session_start();
$Username = $_SESSION['user'];
$auth = $_SESSION['auth'];

//check to make sure the session variable is registered
if(session_is_registered($Username) && ($auth == true)){

//the session variable is registered, the user is allowed to see anything that follows
$MetaRefresh = "<meta http-equiv=\"refresh\" content=\"600;URL=".$root."/index.php\">";

 ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>EDM/Photo Equipment Checkout</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php echo $MetaRefresh ?>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
<script type="text/javascript" src="<?php echo $root; ?>/includes/prototype.js"></script>
<script type="text/javascript">
function hide() {
	$('alert').style.visibility = "hidden";
}
function hide2() {
	$('alert2').style.visibility = "hidden";
}
</script>
<link href="<?php echo $root; ?>/includes/equip.css" rel="stylesheet" type="text/css">
</head>
<?php 
$echo = basename($_SERVER['PHP_SELF'],php);
if ($echo == "login" || $echo == "fines" || $echo == "index") { ?>
<body OnLoad=$('StudentID').focus();>
<?php } else { ?>
<body>
<?php } 
//Print_r ($_SESSION);
?>

<div id="logout"><a class="logout" href="<?php echo $root; ?>/logout.php"><img src="<?php echo $root; ?>/images/logout_icon.png">&nbsp;<strong>Logout</strong></a></div>
<div id="main">
		<div id="gray-bar"></div>
		<div id="header">
			<a href="<?php echo $root; ?>/index.php"><img src="<?php echo $root; ?>/images/logo.jpg" align="center" width="308" height="127"></a>
			<ul id="header-nav">
				<li><a href="<?php echo $root; ?>/allequipmentbyclass.php?StudentID=<? echo $_REQUEST['StudentID'] ?>">All Equipment</a></li>
				<li><a href="<?php echo $root; ?>/allstudents.php">Students List</a></li>
				<li><a href="<?php echo $root; ?>/currentlycheckedout.php?StudentID=<? echo $_REQUEST['StudentID'] ?>">Checked Out</a></li>
				<li><a href="<?php echo $root; ?>/reserved.php?StudentID=<? echo $_REQUEST['StudentID'] ?>">Reservations</a></li>
				<li><a href="<?php echo $root; ?>/fines.php?StudentID=<?php echo $_REQUEST['StudentID'] ?>"><? if (!$fines) { echo "Strikes"; } else { echo "Fines"; } ?> List</a></li>
			</ul>
		</div>
		<div id="content">
<? 
} else {
	header('location:'.$root.'/login.php');
}
?>